package view;

import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

public abstract class AbstractGUI extends JFrame
{
	protected JButton backButton=null;
	
	/**
	 * This method displays a msg to user
	 * @param message - a meassage to display
	 * @param title - the title string for the dialog
	 * @param messageType - the type of message to be displayed:
	 *  0 = ERROR_MESSAGE , 1 = INFORMATION_MESSAGE , 2 = WARNING_MESSAGE , 
	 *  3 = QUESTION_MESSAGE , 4 = PLAIN_MESSAGE 
	 * */
	
	
	public void displayInfoMessage(String message,String title,int messageType)
	{
		JOptionPane.showMessageDialog(this, message, title,messageType);
	}
	
	/**
	 * This method adds an action listener to back to menu button.
	 * @param listener
	 */
	public void addBackActionListener(ActionListener listener){
		backButton.addActionListener(listener);
	}
}
